//
//  HttpTool.h
//  HuiLive
//
//  Created by 明明 on 2017/5/11.
//  Copyright © 2017年 MM. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HttpTool : NSObject

/**
 * get请求
 * 1,不需要返回值,网络数据会延迟，并不会马上返回  返回值
 */
+(void)GET:(NSInteger )URLIndex
parameters:(id)parameters
   success:(void (^)(id responseObject))success
   failure:(void (^)(NSError * error))failure;
/**
 * post请求
 *
 */
+(void)POST:(NSInteger )URLIndex
 parameters:(id)parameters
    success:(void (^)(id responseObject))success
    failure:(void (^)(NSError *error))failure;

/**
 * post请求 加本地缓存数据
 *
 */
+(void)POST:(NSInteger)URLIndex
 parameters:(id)parameters
    success:(void (^)(id responseObject))success
    failure:(void (^)(NSError *error))failure
      cache:(void (^)(id cacheObj))cache;


/**
 POST,该请求会在错误的情况下回调错误代码
 */
+(void)POST:(NSInteger)URLIndex
 parameters:(id)parameters
    obj:(void (^)(id responseObject,BOOL success))success
    failure:(void (^)(NSError *error))failure;


+ (void)cancelRequest;

@end
